Repository navigation
feat(metadata): add boolean any/all aggregates to report measures - #433
Merged
Merged
Conversation
Add @agg: any and @agg: all to measure.aggregate in all five ports: a boolean OR / AND over a field.boolean, typed boolean. Null values are ignored, so a group with nothing to judge reads null; @default 0 / 1 reads false / true (rule M9). Postgres lowers to bool_or / bool_and, SQLite and MySQL to MAX / MIN over 0 / 1. Cube export writes a boolean measure. Adds conformance fixtures, the canonical ProgramFlags / ProgramFlagRoster reports, persistence and api-contract scenarios, cube-model cases, docs and a changelog entry.
…le counts Assisted-by: no-mistakes:claude:claude-opus-5-5
…ale counts Assisted-by: no-mistakes:claude:claude-opus-5-5
…s "1 Assisted-by: no-mistakes:claude:claude-opus-5-5
Assisted-by: no-mistakes:claude:claude-opus-5-5
…nd Java compile gates; declare the field the any/all doc example reads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
@agg: anyand@agg: allto the FR-044measure.aggregatevocabulary in all five ports (boolean OR / AND over afield.boolean@of). The measure is typedboolean. Postgres writesbool_or/bool_and; SQLite and MySQL writeMAX/MINover0/1. A@defaulton such a measure must be0or1, elseERR_INVALID_MEASURE, andany/allover a non-boolean field is refused.cube-modelgenerator writes these measures as Cubebooleanmeasures. Postgres returns a JSON boolean; MySQL returns the string"1"or"0".measure.ratiooperand validation (rule M6) in all five ports: operands must be numeric aggregates, soany/allandmin/maxover non-numeric fields are refused at load. Adds conformance fixtures for the new rules, the boolean measure shapes, and the ratio operand refusals, plus persistence and API-contract report coverage on Postgres, SQLite and MySQL. Documents the feature in the reporting docs and CHANGELOG under 1.1.0.Validation runs
This took three gate runs. Runs 1 and 2 failed at the test step: the baseline test command passed both times, and the test agent's live-evidence sub-step then timed out on its provider (2000s per attempt). Neither run failed on code. Run 3 passed. Run 1 also carried the review fix rounds that are part of this branch.
Known and unchanged: the Cube lane for the new boolean measure was run live on Postgres and MySQL (54 cases pass). MySQL has no boolean type, so Cube returns
"1"/"0"there; this is documented indocs/features/cube-export.md.Validation
Risk Assessment
--quicktest step.Testing
The Cube live lane served the boolean any/all reports (ProgramFlags, ProgramFlagRoster) from Cube on real Postgres and MySQL and matched the SQL view values (54 pass, 0 fail). The quick CI gate passed every gate except
ts build + typecheck, which failed once on a transientcli/test/fixtures/__tmp__/shared-model-*directory that a test created and removed while thetest/**/*typecheck glob was reading it. A fresh build and typecheck over the whole workspace passed, and the worktree is clean. As the attached plan instructed, I did not run the full strict suite without--only; the quick gate and the Cube lane are the broad regression here. Evidence logs are in the evidence directory.ts build + typecheckis robustcli/test/fixtures/__tmp__dir) did not reproduce; typecheck-rerun.log exit 0 for build and typecheck across all packages. This is a test-tmp-dir race,…Evidence: Cube live lane log (Postgres + MySQL)
Evidence: Quick CI log (one flaky typecheck)
Evidence: Isolated build+typecheck re-run
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
docs/features/cube-export.md:648- Stale count left by this change. It addsfixtures/cube-model/measure-boolean-mysql/, so the cube-model corpus now holds three MySQL cases (dimension-time-mysql,measure-mysql,measure-boolean-mysql; each hascase.jsonwith"dialect": "mysql"). Three sites still say two: docs/features/cube-export.md:648 "The two MySQL mapping cases are compiled, never executed"; docs/CONFORMANCE.md:138 "the two MySQL cases included"; docs/CONFORMANCE.md:146 "the two MySQL cases ... are still compiled, not executed". The change already updated the neighbouring counts in both files (44 to 46 cases, 34 to 36 trees). Fix: say three at each site. The statement itself stays true: the new case is compiled only, and the boolean measures run on MySQL through the canonical reports.✅ **Test** - passed
✅ No issues found.
ts build + typecheckis robustcli/test/fixtures/__tmp__dir) did not reproduce; typecheck-rerun.log exit 0 for build and typecheck across all packages. This is a test-tmp-dir race,…scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchainsscripts/ci-local.sh --only cube(Docker: real Cube + Postgres, Cube + MySQL; 54 tests, 0 fail)scripts/ci-local.sh --quick(hygiene, doc/site drift, requirements, fixture-lint, TS conformance, TS unit suites, mutation gate, drift gates)bun run --filter '*' build && bun run --filter '*' typecheckre-run in isolation after the one flaky typecheck in the quick run (exit 0)Baselinescripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchains(ran before this step, passed)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.